
<h1>My Errors</h1>
<% if @browser_grouped.length > 0%>
	<h2>Overview</h2>
	<div class="table_container">
	<table cellspacing='5' style='FLOAT: left;'>
		<tr>
			<th style='text-align: left'>browser</th>
			<th>new</th>
			<th>accepted</th>
			<th>resolved</th>
			<th>closed</th>
			<th>week</th>
			<th>month</th>
			<th>total</th>
		</tr>
		
		<%@browser_grouped.each{|browser, errors|%>
		<tr>
			<td style='text-align: left'><%= small_browser_img browser %> <%= browser%> </td>
			<%@columns.each{|group|%>
				<td><%=link_to errors[group], :controller => 'errors', :browser => browser, :group => group%></td>
			<%}%>
		</tr>
		<%}%>
		<tfoot>
			<tr>
				<td style='text-align: left; padding-left: 22px'> All</td>
				<%@columns.each{|group|%>
					<td><%=link_to @totals[group], :controller => 'errors', :browser => 'all', :group => group%></td>
				<%}%>
			</tr>
		</tfoot>
	</table>
	</div>
	<div class='clear'></div>
	<h2>Most common errors</h2>
	<div class="table_container">
		<table cellspacing='5'>
			<tr>
					<th class='first'>Subject</th>
					<th>Occurances</th>
			</tr>
			<%for error in @common%>
				<tr>
					<td class='first'><%=link_to(h(error.subject_preview(75)), :controller => 'errors', :action => 'index', :compare => error.compare) %></td>
					<td style='text-align: right;'><%=error.count%></td>
				</tr>
			<%end%>
		</table>
	</div>
	<h2>Recent new errors</h2>
	<div class="table_container">
		<table cellspacing='5'>
			<tr>
					<th class='first'>Subject</th>
					<th>Date</th>
			</tr>
			<%for error in @newest%>
				<tr>
					<td class='first subject'><%=link_to h(error.subject_preview(75)), error_path(error) %></td>
					<td style='text-align: right;'><%=error.created_at.getlocal.strftime("%m/%d/%y %H:%M %p")%></td>
				</tr>
			<%end%>
		</table>
	</div>
<%else%>
	<p>You have no errors.</p>
<%end%>